package com.shujia.mrjq

import java.io.InputStream
import scala.io.Source

object ZqzfUtil {
  def getCode(wfxw:String):List[String] = {
    val resourceStream: InputStream = this
      .getClass // 获取当前的类对象
      .getClassLoader // 获取类加载器
      .getResourceAsStream("zqzf_indexs.txt")
    val wfxwMap: Map[String, List[String]] = Source
      .fromInputStream(resourceStream)
      .getLines()
      .map(line => {
        val splits = line.split("-")
        (splits(0), splits(1).split(",").toList)
      }).toMap
    wfxwMap.getOrElse(wfxw, Nil)
  }

  def main(args: Array[String]): Unit = {

    println(getCode("yjjs"))

  }

}
